﻿using Microsoft.AspNetCore.Components;
using MudBlazor.Utilities;
using MXERP.Blazor.Utilities;

namespace MXERP.Client.Components
{
    public partial class Modal
    {
        [Parameter, EditorRequired]
        public string Title { get; set; } = default!;
        [Parameter]
        public RenderFragment? ChildContent { get; set; }
        [Parameter]
        public RenderFragment? ButtonContent { get; set; }
        [Parameter]
        public string Width { get; set; } = "800";
        [Parameter]
        public string Height { get; set; } = "600";
        public string TitleClassName =>
            new CssBuilder($"mud-elevation-1")
            .Build();
        public string ButtonClassName =>
           new CssBuilder($"mud-elevation-1")
           .Build();
        public string ModalStyle =>
            new StyleBuilder()
            .AddStyle("width", !string.IsNullOrWhiteSpace(Width) ? (CssSizeLength)Width : "")
            .AddStyle("height", !string.IsNullOrWhiteSpace(Height) ? (CssSizeLength)Height : "")
            .Build();
    }
}
